import os
from langchain_community.chat_models import ChatZhipuAI 
from dotenv import load_dotenv, find_dotenv

_ = load_dotenv(find_dotenv())
model = os.environ.get('model')
if model is None:
    raise ValueError("model is not set in the .env file")

llm = ChatZhipuAI(model=model,
                  temperature=0.9,              
        )

result = llm.invoke("讲一个笑话。")
print(result.content)
# print(result)